package biz.obake.team.touchprotector.features.proximity;

import android.os.Handler;
import biz.obake.team.touchprotector.R;
import biz.obake.team.touchprotector.d.c;
import biz.obake.team.touchprotector.tpservice.TPService;
import java.util.List;
import java.util.Map;

public class a extends biz.obake.team.touchprotector.d.b implements c.b {

    /* renamed from: d  reason: collision with root package name */
    private Handler f1655d = new Handler();

    /* renamed from: biz.obake.team.touchprotector.features.proximity.a$a  reason: collision with other inner class name */
    class C0074a implements Runnable {

        /* renamed from: b  reason: collision with root package name */
        final /* synthetic */ String f1656b;

        C0074a(String str) {
            this.f1656b = str;
        }

        public void run() {
            TPService.l("RequestChannel.Proximity", "Lock", this.f1656b);
            a.this.f();
        }
    }

    class b implements Runnable {
        b(a aVar) {
        }

        public void run() {
            biz.obake.team.touchprotector.g.c.f("Proximity.FalseTesting", false);
        }
    }

    class c implements Runnable {

        /* renamed from: b  reason: collision with root package name */
        final /* synthetic */ boolean f1658b;

        /* renamed from: c  reason: collision with root package name */
        final /* synthetic */ String f1659c;

        c(a aVar, boolean z, String str) {
            this.f1658b = z;
            this.f1659c = str;
        }

        public void run() {
            String str;
            String str2;
            if (this.f1658b) {
                str2 = this.f1659c;
                str = "UnlockForce";
            } else {
                str2 = this.f1659c;
                str = "Unlock";
            }
            TPService.l("RequestChannel.Proximity", str, str2);
        }
    }

    private class d {

        /* renamed from: a  reason: collision with root package name */
        boolean f1660a;

        /* renamed from: b  reason: collision with root package name */
        boolean f1661b;

        /* renamed from: c  reason: collision with root package name */
        boolean f1662c;

        /* renamed from: d  reason: collision with root package name */
        boolean f1663d;
        boolean e;
        boolean f;
        boolean g;
        boolean h;
        boolean i;
        long j;
        long k;
        boolean l;
        boolean m;

        private d(a aVar) {
            String c2 = biz.obake.team.touchprotector.g.c.c("TPService.State");
            this.f1660a = "Locked".equals(c2);
            this.f1661b = "Unlocked".equals(c2);
            this.f1662c = "RequestChannel.Proximity".equals(biz.obake.team.touchprotector.g.c.c("TPService.LockedBy"));
            String c3 = biz.obake.team.touchprotector.g.c.c("Proximity.State");
            String c4 = biz.obake.team.touchprotector.g.c.c("Proximity.PreState");
            boolean z = true;
            this.f1663d = "Covered".equals(c3) && !"Covered".equals(c4);
            this.e = (!"Uncovered".equals(c3) || "Uncovered".equals(c4)) ? false : z;
            this.f = biz.obake.team.touchprotector.g.a.g("lock_proximity");
            this.g = biz.obake.team.touchprotector.g.a.g("unlock_proximity");
            this.h = biz.obake.team.touchprotector.g.a.g("unlock_proximity_uncovered");
            this.i = biz.obake.team.touchprotector.g.a.g("unlock_proximity_uncovered_force");
            this.j = Long.parseLong(biz.obake.team.touchprotector.g.a.l("proximity_sensitivity"));
            this.k = Long.parseLong(biz.obake.team.touchprotector.g.a.l("proximity_sensitivity_uncovered"));
            this.l = biz.obake.team.touchprotector.g.c.b("Proximity.FalseTesting");
            this.m = "Bright".equals(biz.obake.team.touchprotector.g.c.c("ProximityLight.State"));
        }

        /* synthetic */ d(a aVar, C0074a aVar2) {
            this(aVar);
        }
    }

    public static void d(Map<String, String> map) {
        map.put("RequestChannel.Proximity", "None");
        map.put("Proximity.FalseTesting", "false");
    }

    private void e(String str, long j) {
        C0074a aVar = new C0074a(str);
        if (j == 0) {
            aVar.run();
        } else {
            this.f1655d.postDelayed(aVar, j);
        }
    }

    /* access modifiers changed from: private */
    public void f() {
        String l = biz.obake.team.touchprotector.g.a.l("proximity_false_testing");
        if (!"disabled".equals(l)) {
            long parseLong = Long.parseLong(l);
            biz.obake.team.touchprotector.g.c.f("Proximity.FalseTesting", true);
            this.f1655d.postDelayed(new b(this), parseLong);
        }
    }

    private void g(String str, long j, boolean z) {
        c cVar = new c(this, z, str);
        if (j == 0) {
            cVar.run();
        } else {
            this.f1655d.postDelayed(cVar, j);
        }
    }

    public void a(List<String> list) {
        d dVar = new d(this, (C0074a) null);
        if (dVar.g) {
            list.add(biz.obake.team.touchprotector.c.w(R.string.proximity_unlockingway_covered));
        }
        if (dVar.h && dVar.f1662c) {
            list.add(biz.obake.team.touchprotector.c.w(R.string.proximity_unlockingway_uncovered));
        }
        if (dVar.i) {
            list.add(biz.obake.team.touchprotector.c.w(R.string.proximity_unlockingway_uncovered_force));
        }
    }

    /* access modifiers changed from: protected */
    /* JADX WARNING: Removed duplicated region for block: B:12:0x0028 A[ADDED_TO_REGION] */
    /* JADX WARNING: Removed duplicated region for block: B:15:0x003f  */
    /* JADX WARNING: Removed duplicated region for block: B:20:0x004d  */
    /* JADX WARNING: Removed duplicated region for block: B:22:0x0055  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public void b(java.lang.String r6) {
        /*
            r5 = this;
            int r0 = r6.hashCode()
            r1 = -1316838470(0xffffffffb182a3ba, float:-3.8021115E-9)
            r2 = 0
            r3 = 1
            if (r0 == r1) goto L_0x001b
            r1 = -89166302(0xfffffffffaaf6e22, float:-4.5544285E35)
            if (r0 == r1) goto L_0x0011
            goto L_0x0025
        L_0x0011:
            java.lang.String r0 = "Proximity.State"
            boolean r6 = r6.equals(r0)
            if (r6 == 0) goto L_0x0025
            r6 = 0
            goto L_0x0026
        L_0x001b:
            java.lang.String r0 = "ProximityLight.State"
            boolean r6 = r6.equals(r0)
            if (r6 == 0) goto L_0x0025
            r6 = 1
            goto L_0x0026
        L_0x0025:
            r6 = -1
        L_0x0026:
            if (r6 == 0) goto L_0x002c
            if (r6 == r3) goto L_0x002c
            goto L_0x00a7
        L_0x002c:
            biz.obake.team.touchprotector.features.proximity.a$d r6 = new biz.obake.team.touchprotector.features.proximity.a$d
            r0 = 0
            r6.<init>(r5, r0)
            android.os.Handler r1 = r5.f1655d
            r1.removeCallbacksAndMessages(r0)
            java.lang.String r0 = "Proximity.FalseTesting"
            boolean r1 = biz.obake.team.touchprotector.g.c.b(r0)
            if (r1 == 0) goto L_0x0042
            biz.obake.team.touchprotector.g.c.f(r0, r2)
        L_0x0042:
            boolean r0 = r6.f1660a
            if (r0 == 0) goto L_0x0055
            boolean r0 = r6.e
            boolean r1 = r6.l
            r0 = r0 & r1
            if (r0 == 0) goto L_0x0055
            r0 = 0
            java.lang.String r6 = "False Testing"
        L_0x0051:
            r5.g(r6, r0, r3)
            goto L_0x00a7
        L_0x0055:
            boolean r0 = r6.f1661b
            java.lang.String r1 = "Covered"
            if (r0 == 0) goto L_0x006d
            boolean r0 = r6.f1663d
            if (r0 == 0) goto L_0x006d
            boolean r0 = r6.f
            if (r0 == 0) goto L_0x006d
            boolean r0 = r6.m
            if (r0 != 0) goto L_0x006d
            long r2 = r6.j
            r5.e(r1, r2)
            goto L_0x00a7
        L_0x006d:
            boolean r0 = r6.f1660a
            if (r0 == 0) goto L_0x007f
            boolean r0 = r6.f1663d
            if (r0 == 0) goto L_0x007f
            boolean r0 = r6.g
            if (r0 == 0) goto L_0x007f
            long r3 = r6.j
            r5.g(r1, r3, r2)
            goto L_0x00a7
        L_0x007f:
            boolean r0 = r6.f1660a
            if (r0 == 0) goto L_0x0094
            boolean r0 = r6.e
            if (r0 == 0) goto L_0x0094
            boolean r0 = r6.f1662c
            if (r0 == 0) goto L_0x0094
            boolean r0 = r6.h
            if (r0 == 0) goto L_0x0094
            long r0 = r6.k
            java.lang.String r6 = "Uncovered"
            goto L_0x0051
        L_0x0094:
            boolean r0 = r6.f1660a
            if (r0 == 0) goto L_0x00a7
            boolean r0 = r6.e
            if (r0 == 0) goto L_0x00a7
            boolean r0 = r6.i
            if (r0 == 0) goto L_0x00a7
            long r0 = r6.k
            java.lang.String r6 = "Uncovered Force"
            r5.g(r6, r0, r2)
        L_0x00a7:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: biz.obake.team.touchprotector.features.proximity.a.b(java.lang.String):void");
    }
}
